<template>
    <div class="app-container">
        <el-form ref="dataForm" :rules="rules" :model="formData" label-width="80px">
{volist name="data['columns']" id="item" key="i"}
            <el-form-item label="{$item.field_desc}" prop="{$item.field}">
                <el-input v-model="formData.{$item.field}" placeholder="请输入{$item.field_desc}"></el-input>
            </el-form-item>
{/volist}
        </el-form>
        <sticky :z-index="1000" direction="bottom">
            <el-card shadow="always" :body-style="{padding:'15px','text-align':'center'}">
                <router-link :to="'/{$data.table_name}/list'"><el-button icon="el-icon-back">返回</el-button></router-link>
                <el-button type="primary" icon="el-icon-upload" @click="createData()">提交</el-button>
            </el-card>
        </sticky>
    </div>
</template>

<script>
import commonEdit from '@/utils/commonEdit'
import api from '@/api/{$data.table_name}'
export default {
    mixins: [commonEdit],
    data() {
        return {
            api,
            primary_key:'{$data.pk}',
            formData:{}
        }
    },
    mounted() {
        this.fetchData()
    }
}
</script>

<style lang="scss" scoped>
</style>
